/**
 * 
 */
package com.block.common.security.service.factory;

import com.block.common.security.service.ReqDataTransferService;
import com.block.common.security.service.impl.reqData.DefaultReqTransferService;
import com.block.common.security.service.impl.reqData.MiniReqTransferService;
import com.block.common.security.service.impl.reqData.XHYReqTransferServiceImpl;

import java.util.HashMap;
import java.util.Map;


/**
 * 
 * 请求数据转换工厂
 */
public class ReqDataTransferFactory {
	
	/**
	 * 【请求数据转换】MAP
	 */
	private static Map<String, ReqDataTransferService> reqDataTransferMap = null;
	static 
	{
		reqDataTransferMap = new HashMap<String, ReqDataTransferService>();
		reqDataTransferMap.put("XHY",new XHYReqTransferServiceImpl());
		reqDataTransferMap.put("JS",new MiniReqTransferService());
		reqDataTransferMap.put("DEFAULT",new DefaultReqTransferService());
	}
	
	/**
	 * 获得【请求数据转换】
	 * @param type
	 * @return
	 */
	public static ReqDataTransferService getReqDataTransferService(String type)
	{
		ReqDataTransferService req= reqDataTransferMap.get(type);
		if(req==null) {
            return new DefaultReqTransferService();
        } else {
            return req;
        }
	}
	
}
